import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

// 全局引入 elementPlus 图标
// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import Enum from './constant/enum'
import EnumModule from './constant/module'

import App from './App.vue'
import router from './router'

import { setupProdMockServer } from '@/mock';
if ( import.meta.env.MODE === 'production' && import.meta.env.VITE_MOCK_ENABLE==='true' ) {
  setupProdMockServer();
}

const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}


app.use(createPinia())
app.use(router)
app.use(ElementPlus)
app.use(Enum, EnumModule)

app.mount('#app')
